package studay.composite;

/**
 * @program: 设计模式
 * @description: 测试文件模拟
 * @author: Tom
 * @create: 2022-01-06 21:57
 **/
public class File extends Root{

    public File(String name) {
        super(name);
    }

    @Override
    public void addFile(Root root) {

    }

    @Override
    public void removeFile(Root root) {

    }

    @Override
    public void display(int depth) {
        StringBuilder sb = new StringBuilder();
        for (int i=0;i<depth;i++){
            sb.append("_");
        }
        System.out.println(new String(sb)+this.getName());
    }
}
